package com.keyue.service.admin;

import com.baomidou.mybatisplus.extension.service.IService;
import com.keyue.common.constant.ServerResult;
import com.keyue.domain.dto.admin.AdminRoleDO;
import com.keyue.domain.vo.UserVO;
import com.keyue.domain.vo.admin.AdminAuthRoleVO;
import com.keyue.domain.vo.admin.AdminRoleQueryVO;
import com.keyue.domain.vo.admin.AdminRoleVO;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * 角色表(AdminRole)表服务接口
 *
 * @author makejava
 * @since 2023-08-30 17:51:48
 */
public interface AdminRoleService extends IService<AdminRoleDO> {

    /**
     * 通过ID查询单条数据
     *
     * @param adminRoleQueryVO 主键
     * @return 实例对象
     */
    ServerResult queryById(AdminRoleQueryVO adminRoleQueryVO);

    /**
     * 分页查询
     *
     * @param adminRoleQueryVO 筛选条件
     * @return 查询结果
     */
    ServerResult listByPage(AdminRoleQueryVO adminRoleQueryVO);

    /**
     * @param adminRoleQueryVO
     * @return
     */
    ServerResult list(AdminRoleQueryVO adminRoleQueryVO);

    /**
     * @param level
     * @return
     */
    ServerResult listByLevel(Integer level);

    /**
     * 新增数据
     *
     * @param adminRoleVO 数据VO
     * @return 新增结果
     */
    ServerResult add(AdminRoleVO adminRoleVO);

    /**
     * 修改数据
     *
     * @param adminRoleVO 数据VO
     * @return 编辑结果
     */
    ServerResult edit(AdminRoleVO adminRoleVO);

    /**
     * 角色-菜单-授权
     *
     * @param adminAuthRoleVO
     * @return
     */
    ServerResult authMenu(AdminAuthRoleVO adminAuthRoleVO);

    /**
     * 通过主键删除数据
     *
     * @param adminRoleQueryVO 筛选条件
     * @return 是否成功
     */
    ServerResult deleteById(AdminRoleQueryVO adminRoleQueryVO);

    /**
     * @param user
     * @return
     */
    public Collection<GrantedAuthority> mapToGrantedAuthorities(UserVO user);

}
